#ifndef CHARTPREVIEW_H
#define CHARTPREVIEW_H

#include <QWidget>
#include <QPaintEvent>
#include <QPainter>
#include "blldataflow.h"
#include "shadow.h"
#include "project.h"
#include <QtCharts>
#include <QtCharts/QChart>
#include <QtCharts/QLineSeries>

namespace Ui {
class ChartPreview;
}

class ChartPreview : public QWidget
{
    Q_OBJECT

public:
    explicit ChartPreview(QWidget *parent = nullptr);
    ~ChartPreview();

private slots:
    void on_btnClose_clicked();

    void retranslateUiSlot();

    void setWidgetParent();

public:
    void viewChart(QString chartDataFileName);

protected:
    void paintEvent(QPaintEvent *);
    void showEvent(QShowEvent *);

private:
    void initWidget();

private:
    Ui::ChartPreview * ui;
    BllDataFlow * bdf;
    QLineSeries * seriesExp;
    QValueAxis * xAxisExp;
    QValueAxis * yAxisExp;
};

#endif // CHARTPREVIEW_H
